package 编程题;

import java.util.*;

public class Num_8_3_01{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        while(sc.hasNextInt()){
            int n = sc.nextInt();
            sc.nextLine(); //吸收空格
            String[] str = new String[n];

            for(int i = 0; i < n; i++){
                str[i] = sc.nextLine();

                if( str[i].contains(",") || str[i].contains(" ") ){
                    //说明此时的收件人名字中带逗号或空格
                    System.out.print("\"" + str[i] + "\"" );
                }else{
                    System.out.print(str[i]);
                }

                if(i != n - 1){
                    System.out.print(", ");
                }

            }
            System.out.println();


        }
    }
}